Facial recognition method, facial recognition system, and non-transitory recording medium

ABSTRACT

The embodiments of this application provide a facial recognition method and system, and a non-transitory recording medium. The method includes: obtaining a first feature vector of a first face in a first facial image and a first confidence vector having the same dimension as the first feature vector, wherein elements in the first confidence vector are used to indicate credibility of features represented by the corresponding elements in the first feature vector; obtaining a second feature vector of a second face in a second facial image and a second confidence vector having the same dimension as the second feature vector, wherein elements in the second confidence vector are used to indicate credibility of features represented by the corresponding elements in the second feature vector; and determining the first confidence vector, the second feature vector and the second confidence vector, whether the first and second face belong to the same person.

CROSS-REFERENCE TO RELATED APPLICATION

The present application claims the priority of Chinese patentapplication No. 201810084836.2 filed on Jan. 29, 2018, the disclosure ofwhich is incorporated herein by reference in its entirety.

TECHNICAL FIELD

The present disclosure relates to the field of image processing, andmore particularly, to a facial recognition method, a facial recognitionsystem, and a non-transitory recording medium.

BACKGROUND

In the field of facial recognition, it is usually necessary to determinewhether two faces belong to the same person. Specifically, thedetermination is made by extracting features from the faces andperforming comparison. However, due to the possibility of face occlusionor the like, noise of the extracted features may be too large, whichfurther results in a low recognition accuracy.

SUMMARY

The present disclosure provides a facial recognition method, a facialrecognition system, and a non-transitory recording medium, which achievea high recognition accuracy even for occluded faces.

According to an aspect of the present disclosure, there is provided afacial recognition method, the method comprising:

obtaining a first feature vector of a first face in a first facial imageand a first confidence vector having the same dimension as the firstfeature vector, wherein elements in the first confidence vector are usedto indicate credibility of features represented by the correspondingelements in the first feature vector;

obtaining a second feature vector of a second face in a second facialimage and a second confidence vector having the same dimension as thesecond feature vector, wherein elements in the second confidence vectorare used to indicate credibility of features represented by thecorresponding elements in the second feature vector; and

determining, according to the first feature vector, the first confidencevector, the second feature vector and the second confidence vector,whether the first face and the second face belong to the same person.

According to another aspect of the present disclosure, there is providedan apparatus for facial recognition, the apparatus is for carrying outsteps of the method according to the aspects described above or therespective embodiments, the apparatus comprising:

an obtaining module configured to obtain a first feature vector of afirst face in a first facial image and a first confidence vector havingthe same dimension as the first feature vector, wherein elements in thefirst confidence vector are used to indicate credibility of featuresrepresented by the corresponding elements in the first feature vector;

-   -   the obtaining module being further configured to obtain a second        feature vector of a second face in a second facial image and a        second confidence vector having the same dimension as the second        feature vector, wherein elements in the second confidence vector        are used to indicate credibility of features represented by the        corresponding elements in the second feature vector; and

a calculating module configured to determine, according to the firstfeature vector, the first confidence vector, the second feature vectorand the second confidence vector, whether the first face and the secondface belong to the same person.

According to yet another aspect of the present disclosure, there isprovided a facial recognition system, comprising a memory, a processor,and a computer program stored in the memory and running on theprocessor, wherein steps of the facial recognition method according tothe aspects described above or the respective examples are carried outwhen the processor executes the computer program.

According to still yet another aspect of the present disclosure, thereis provided a non-transitory recording medium on which a computerprogram is stored, wherein steps of the facial recognition methodaccording to the aspects described above or the respective examples arecarried out when the computer program is executed by a processor.

Accordingly, in the embodiments of the present disclosure, credibilityof respective elements in the corresponding feature vector can berepresented by the confidence vector, and further, similarity betweentwo faces can be jointly calculated based on the feature vector and theconfidence vector, which can avoid the feature vector unavailabilitysituation caused by face occlusion, and the similarity obtained by thismethod is independent of the occlusion state, thereby ensuring theaccuracy of facial recognition.

BRIEF DESCRIPTION OF THE DRAWINGS

Through the more detailed description of embodiments of the presentdisclosure with reference to the accompanying drawings, the above andother objectives, features, and advantages of the present disclosurewill become more apparent. The drawings are to provide furtherunderstanding for the embodiments of the present disclosure andconstitute a portion of the specification, and are intended to interpretthe present disclosure together with the embodiments rather than tolimit the present disclosure. In the drawings, the same reference signgenerally refers to the same component or step.

FIG. 1 is a schematic block diagram of an electronic device according toan embodiment of the present disclosure;

FIG. 2 is a schematic flowchart of a facial recognition method accordingto an embodiment of the present disclosure;

FIG. 3 is a schematic block diagram of an apparatus for facialrecognition according to an embodiment of the present disclosure; and

FIG. 4 shows a schematic diagram of a non-transitory recording mediumprovided by an embodiment of the present disclosure.

DETAILED DESCRIPTION OF THE EMBODIMENTS

To make the objectives, technical solutions, and advantages of thepresent disclosure more clear, exemplary embodiments of the presentdisclosure will be described in detail with reference to theaccompanying drawings. Obviously, these described embodiments merely areonly part of the embodiments of the present disclosure, rather than allof the embodiments of the present disclosure, it should be understoodthat, the present disclosure is not limited to the exemplary embodimentsdescribed herein. All other embodiments obtained by a person skilled inthe art based on the embodiments described in the present disclosurewithout paying inventive efforts should all fall into the protectionscope of the present disclosure.

The embodiments of the present disclosure may be applied to anelectronic device. FIG. 1 shows a schematic block diagram of anelectronic device according to an embodiment of the present disclosure.The electronic device 10 shown in FIG. 1 comprises one or moreprocessors 102, one or more storage devices 104, an input device 106, anoutput device 108, an image sensor 110 and one or more non-image sensors114, these components are interconnected through a bus system 112 and/orother forms. It should be noted that, components and structures of theelectronic device 10 shown in FIG. 1 are merely exemplary, notrestrictive, and the electronic device may have other components andstructures as needed.

The processor 102 may include a central processing unit (CPU) 1021 and agraphics processing unit (GPU) 1022 or other forms of processing unitwith data processing capability and/or instruction execution capability,such as Field-Programmable Gate Array (FPGA) or Advanced RISC (ReducedInstruction Set Computer) Machine (ARM), and the processor 102 cancontrol other components in the electronic device 10 to perform desiredfunctions.

The storage device 104 may include one or more computer programproducts, said computer program products may include various forms ofcomputer-readable storage medium, such as a volatile memory 1041 and/ora nonvolatile memory 1042. The volatile memory 1041 may include, forexample, a random access memory (RAM) and/or a cache or the like. Thenonvolatile memory 1042 may include, for example, a read only memory(ROM), a hard disk, a flash memory or the like. One or more computerprogram instructions may be stored on the computer-readable storagemedium, and the processor 102 may execute the program instructions toimplement various desired functions. Various application programs andvarious data may also be stored in the computer-readable storage medium,such as various data used and/or generated by the application programsor the like.

The input device 106 may be a device used by a user to input aninstruction, and may include one or more of a keyboard, a mouse, amicrophone, a touch screen or the like.

The output device 108 may output various types of information (e.g.,image or sound) to the outside (e.g., a user), and may include one ormore of a display, a speaker or the like.

The image sensor 110 may capture images (e.g., photos, videos, etc.)desired by the user and store the captured images in the storage device104 for use by other components.

It should be noted that, the components and structures of the electronicdevice 10 illustrated in FIG. 1 are merely exemplary, although theelectronic device 10 illustrated in FIG. 1 includes a plurality ofdifferent devices, some of them may not be necessary as desired, whereinthe number of some devices may be more, etc., and the present disclosureis not limited thereto.

FIG. 2 is a schematic flowchart of a schematic flowchart of a facialrecognition method according to an embodiment of the present disclosure,the method shown in FIG. 2 comprises:

S101, obtaining a first feature vector of a first face in a first facialimage and a first confidence vector having the same dimension as thefirst feature vector, wherein elements in the first confidence vectorare used to indicate credibility of features represented by thecorresponding elements in the first feature vector;

S102, obtaining a second feature vector of a second face in a secondfacial image and a second confidence vector having the same dimension asthe second feature vector, wherein elements in the second confidencevector are used to indicate credibility of features represented by thecorresponding elements in the second feature vector; and

S103, determining, according to the first feature vector, the firstconfidence vector, the second feature vector and the second confidencevector, whether the first face and the second face belong to the sameperson.

Exemplarily, the embodiment of the present disclosure makes nolimitation to the execution order of S110 and S120, and they may beperformed, for example, in parallel.

Exemplarily, the method shown in FIG. 2 may further comprise: obtaininga first facial image and a second facial image. The first facial imageand the second facial image may be original images that include a facecaptured by an image acquisition device, or may be facial images aftergoing through image preprocessing (such as denoising, normalization,etc.). For example, the first facial image and the second facial imageare captured using the image acquisition device, or the first facialimage and the second facial image are obtained from a memory, or thefirst facial image is captured using the image acquisition device, whilethe second facial image is obtained from the memory (e.g., the secondfacial image is a database image).

Exemplarily, S110 and S120 may be performed by a trained neural network.Specifically, the first facial image may be inputted to the trainedneural network to obtain the first feature vector and the firstconfidence vector. The second facial image may be inputted to thetrained neural network to obtain the second feature vector and thesecond confidence vector.

It can be understood that, before S110, the method further comprise:obtaining the neural network by training. Specifically, a face sampleimage data set may be constructed, wherein at least part of the sampleimages in the data set may have annotation information including a facefeature vector and a corresponding confidence vector. Optionally, theexisting feature extraction neural network may be used to obtain theface feature vector of each sample image, and the correspondingconfidence vector may be marked based on the face condition (such as theface occlusion situation) in each sample image. The sample images in thedata set are inputted to the neural network to be trained, and an errorbetween the output information of the neural network and the annotationinformation is optimized by adjusting parameters of the neural networkto train the neural network.

Herein, the data set may include sample images having various faceocclusion states, such as partial occlusion of the face due to hats,glasses, masks, masks, hands, or other objects.

The error can be optimized based on the gradient descent method.Illustratively, during training, a loss function may be constructed todetermine if it has converged. As an example, if training is performedusing a triplet loss function (Triplet Loss), for the inputted threeimages A1, A2, and A3, the loss function may be defined as a differencebetween a distance based on images A1 and A3 and a distance based onimages A1 and A2, this loss function may be expressed as L=D(A1,A3)−D(A1, A2)). Herein, the distance D(A1, A3) based on images A1 and A3is calculated according to the feature vector and the confidence vectorof A1 as outputted by the neural network and the feature vector and theconfidence vector of A3 as outputted by the neural network; the distanceD (A1, A2) based on images A1 and A2 is calculated based on the featurevector and the confidence vector of A1 as outputted by the neuralnetwork and the feature vector and the confidence vector of A2 asoutputted by the neural network. For details on how to calculate thedistance, reference may be made to the following description of thisspecification, which will not be described in detail here.

It can be understood that, the loss function may also be other formsdefined according to the output of the neural network, the presentdisclosure makes no limitations thereto.

The embodiment of the present invention makes no limitation to thenetwork structure of the neural network adopted, and it may be anynetwork structure such as ResNet, DenseNet, MobileNet, ShuffleNet, andInception.

Exemplarily, other machine learning methods may also be used toimplement S110 and S120, that is, other machine learning methods mayalso be used to acquire the first feature vector and the firstconfidence vector of the first face and the second feature vector andthe second confidence vector of the second face. The embodiment of thepresent disclosure makes no limitation thereto.

The first feature vector and the first confidence vector have the samedimension, which is assumed to be N. Then a certain element of the firstconfidence vector represents confidence of the element of the firstfeature vector at the same position. Specifically, it is assumed thatthe first feature vector is represented as X1 and the first confidencevector is represented as Y1, the i-th element y1 _(i) of Y1 representsconfidence of the i-th element x1 _(i) of X1, and the confidence mayalso be referred to as credibility, it indicates a probability of thatthe corresponding element is an authentic feature of human face. Forexample, x1 _(i) indicates a feature at the i-th position in the firstfacial image, and y1 _(i)=1 indicates that the feature is a feature onthe first face in the first facial image, that is, the i-th position isa facial position without occlusion; y1 _(i)=0 indicates that thefeature x1 _(i) is not a feature on the first face in the first facialimage, that is, the feature x1 _(i) is a feature of the occlusion on thefirst face, that is, the i-th position is the facial position where theocclusion is present. It should be understood that, the first featurevector and the first confidence vector are both real vectors, that is,each element is a real number; and each element of Y1 is a value withinthe range [0, 1].

Similarly, the second feature vector and the corresponding secondconfidence vector also have the same dimension, which is assumed to beN. Then a certain element of the second confidence vector representsconfidence of the element of the second feature vector at the sameposition. Specifically, it is assumed that the second feature vector isrepresented as X2 and the second confidence vector is represented as Y2,the i-th element y2 _(i) of Y2 represents confidence of the i-th elementx2 _(i) of X2, and the confidence may also be referred to ascredibility, it indicates a probability of that the correspondingelement is an authentic feature of human face. It should be understoodthat, the second feature vector and the second confidence vector areboth real vectors, that is, each element is a real number; and eachelement of Y2 is a value within the range [0, 1].

In addition, the confidence vector may also be understood asrepresenting a noise magnitude of the corresponding feature vector.Specifically, the smaller a certain element of the confidence vector is,the greater the noise of the element at the same position of thecorresponding feature vector is.

Further, in S130, whether the first face and the second face havecomparability may be determined according to the first confidence vectorand the second confidence vector; if it is determined as havingcomparability, the similarity between the first face and the second facemay be further calculated according to the first feature vector and thesecond feature vector, otherwise the facial recognition process isstopped or the scenario is renewed and S110 and S120 are re-executed.Herein, not having comparability means that there is no need tocalculate the similarity between the first face and the second face, inthis case, even if the similarity between the first face and the secondface is calculated by some method, the calculated similarity has noreference value for facial recognition; that is, not havingcomparability means that it is impossible to determine whether the firstface and the second face belong to the same person. Having comparabilitymeans that the similarity between the first face and the second face canbe further calculated, and used to determine whether the two belong tothe same person.

Exemplarily, whether there is comparability may be determined accordingto a degree of coincidence of the first confidence vector and the secondconfidence vector. Optionally, a degree of coincidence in credibilitydimensions of two confidence vectors may be determined by calculating aninner product of the two confidence vectors.

It can be seen that, the embodiment of the present disclosure candetermine whether there is comparability according to two confidencevectors, which can avoid inaccuracy of a recognition result due tohaving no comparability.

Optionally, it is possible to calculate a degree of coincidence betweenthe first confidence vector and the second confidence vector; if thedegree of coincidence is less than a preset threshold, it is determinedthat it is impossible to determine whether the first face and the secondface belong to the same person; if the degree of coincidence is greaterthan or equal to the preset threshold, a similarity between the firstface and the second face is calculated according to the first confidencevector, the first feature vector, the second confidence vector and thesecond feature vector, and whether the first face and the second facebelong to the same person is determined according to the similarity.

As an example, if the element in the confidence vector takes a value of0 or 1, the degree of coincidence of two confidence vectors refers to anamount of the same positions whose values are all 1; or, the innerproduct of two confidence vectors may be calculated to obtain the degreeof coincidence. As another example, if the elements in the confidencevector take the value [0, 1], the inner product of two confidencevectors may be calculated to obtain the degree of coincidence. The innerproduct calculation of vectors means that the corresponding elements aremultiplied and then summed, it is assumed that the first confidencevector is represented as Y1, the second confidence vector is representedas Y2, and dimensions of both of them are N, then the calculated innerproduct is:

${\sum\limits_{i = 1}^{N}{y\; 1_{i} \times y\; 2_{i}}},$where y1 _(i) represents the i-th element of Y1, and y2 _(i) representsthe i-th element of Y2.

The preset threshold may be an empirical value, it may be adjustedaccording to scenarios, the present disclosure makes no limitationsthereto.

Optionally, calculating a similarity between the first face and thesecond face according to the first confidence vector, the first featurevector, the second confidence vector and the second feature vector maycomprise: calculating a distance between the first face and the secondface according to the first confidence vector, the first feature vector,the second confidence vector and the second feature vector; andcalculating a similarity between the first face and the second faceaccording to the distance.

As an example, the calculated distance may be directly used as thesimilarity.

As another example, the similarity may be calculated based on theobtained distance. For example, the similarity may be calculated byusing the following formula:

$S = \frac{1}{1 + e^{{A \times D} + B}}$where S represents the similarity, D represents the distance, and A andB are preset parameters. A and B may be fixed parameters obtainedempirically, and the present disclosure makes no limitation thereto.

Optionally, the calculated distance may be referred to as a distancebased on the first facial image and the second facial image. Thedistance may be calculated according to the first feature vector, thefirst confidence vector, the second feature vector and the secondconfidence vector. When calculating the distance, since the factor“confidence” is considered at the same time, the finally calculateddistance can be independent of the occlusion state of the first face andthe second face, thereby making the result of facial recognition moreaccurate.

Specifically, the distance between the first feature vector and thesecond feature vector may be calculated by the following formula:

$D = {\frac{{< {\left( {{X\; 1} - {X\; 2}} \right)*Y\; 1}},{{\left( {{X\; 1} - {X\; 2}} \right)*Y\; 2} >}}{{< {Y\; 1}},{{Y\; 2} >}}.}$Herein, X1 represents the first feature vector, X2 represents the secondfeature vector, Y1 represents the first confidence vector, Y2 representsthe second confidence vector, < > represents calculating an innerproduct, and * represents multiplying by bit. Multiplying by bit meansmultiplying the elements at the same position of the two vectors. Forexample, M=M1*M2, M_(i)=M1 _(i)×M2 _(i) is satisfied, where M_(i), M1_(i), M2 _(i) represent the i-th element of M, M1 and M2.

Illustratively, the above formula may also be expressed as

${D = \frac{K\;{1 \cdot K}\; 2}{Y\;{1 \cdot Y}\; 2}},$where K1, K2, Y1, Y2 are vectors in the same dimension, K1·K2 representsthe inner product of K1 and K2 (i.e., dot product), Y1·Y2 represents theinner product of Y1 and Y2. And the elements of K1 and K2 satisfy: K1_(i)=(X1 _(i)·X2 _(i))×Y1 _(i), K2 _(i)=(X1 _(i)−X2 _(i))×Y2 _(i).Herein, X1 _(i), X2 _(i), Y1 _(i), Y2 _(i), K1 _(i), K2 _(i) representthe i-th element of vectors X1, X2, Y1, Y2, K1, K2.

Therefore, when the degree of coincidence between the first confidencevector and the second confidence vector is greater than or equal to thepreset threshold, the similarity between the first face and the secondface is obtained by calculating the distance. Further, it may bedetermined whether the first face and the second face belong to the sameperson according to the calculated similarity, for example, if thecalculated similarity is greater than or equal to a similaritythreshold, it is determined the first face and the second face belong tothe same person; otherwise, it is determined that they do not belong tothe same person.

In order to more clearly understand the above embodiments, the followingdescription is made by way of example.

It is assumed that the first feature vector of the first face withoutocclusion is (0.5, 0.5, 0.5, 0.5, 0.5), the first confidence vector is(1, 1, 1, 1, 1). It is assumed that the second feature vector of thesecond face without occlusion is (0, 1, 0, 1, 0), and the secondconfidence vector is (1, 1, 1, 1, 1). In this case, the degree ofcoincidence of the two confidence vectors is 5, and the distance betweenthe first feature vector and the second feature vector is 0.25 accordingto the above formula. That is to say, when the first face and the secondface are both unobstructed, the distance is 0.25.

If the first face and the second face each have different degrees ofocclusion, it is assumed that the upper half of the first face isoccluded, the first two dimensional features of the first feature vectorbring great noise, the first feature vector with occlusion is (0, 1,0.5, 0.5, 0.5), and the first confidence vector is (0, 0, 1, 1, 1). Itis assumed that the lower half of the second face is occluded, it bringsgreat noise to the last two dimensional features of the second featurevector, the second feature vector with occlusion is (0, 1, 0, 0.5, 0.5),and the second confidence vector is (1, 1, 1, 0, 0). In this case, thedegree of coincidence of the two confidence vectors is calculated tobe 1. If the preset threshold is greater than 1, such as 2 or 3, sincethe degree of coincidence is less than the preset threshold, the firstface and the second face are not comparable at this time, and thedistance needs not to be calculated. If the preset threshold is lessthan 1, such as 0.5 or 0.8, since the degree of coincidence is greaterthan the preset threshold, the distance may be calculated to be 0.25.That is to say, when the first face and the second face are bothpartially occluded, the distance is still 0.25.

It can be seen that, as for the same two faces, the calculated distancein different occlusion states is constant. That is, the distancecalculated in conjunction with the confidence in the embodiment of thepresent disclosure is independent of the occlusion state, that is, thecalculated distance is not changed due to face occlusion, so that theaccuracy of facial recognition is higher.

FIG. 3 is a schematic block diagram of an apparatus for facialrecognition according to an embodiment of the present disclosure. Theapparatus 30 in FIG. 5 comprises: an obtaining module 310 and a judgingmodule 320.

The obtaining module 310 is configured to obtain a first feature vectorof a first face in a first facial image and a first confidence vectorhaving the same dimension as the first feature vector, wherein elementsin the first confidence vector are used to indicate credibility offeatures represented by the corresponding elements in the first featurevector; and the obtaining module is further configured to obtain asecond feature vector of a second face in a second facial image and asecond confidence vector having the same dimension as the second featurevector, wherein elements in the second confidence vector are used toindicate credibility of features represented by the correspondingelements in the second feature vector.

The judging module 320 is configured to determine, according to thefirst feature vector, the first confidence vector, the second featurevector and the second confidence vector, whether the first face and thesecond face belong to the same person.

Exemplarily, the determining module 320 may comprise a calculatingsub-module 3210 and a determining sub-module 3220. The calculatingsub-module 3210 is configured to calculate a degree of coincidencebetween the first confidence vector and the second confidence vector. Ifthe degree of coincidence calculated by the calculating sub-module 3210is less than a preset threshold, the determining sub-module 3220determines that it is impossible to determine whether the first face andthe second face belong to the same person. If the degree of coincidencecalculated by the calculating sub-module 3210 is greater than or equalto the preset threshold, the calculating sub-module 3210 calculates asimilarity between the first face and the second face according to thefirst confidence vector, the first feature vector, the second confidencevector and the second feature vector, and the determining sub-module3220 determines whether the first face and the second face belong to thesame person according to the similarity.

Exemplarily, the calculating sub-module 3210 may be specificallyconfigured to obtain the degree of coincidence by calculating an innerproduct of the first confidence vector and the second confidence vector.

Exemplarily, the calculating sub-module 3210 may be specificallyconfigured to calculate a distance between the first face and the secondface according to the first confidence vector, the first feature vector,the second confidence vector and the second feature vector; andcalculate a similarity between the first face and the second faceaccording to the distance.

The calculating sub-module 3210 may be specifically configured tocalculate the distance using the following formula:

${D = \frac{{< {\left( {{X\; 1} - {X\; 2}} \right)*Y\; 1}},{{\left( {{X\; 1} - {X\; 2}} \right)*Y\; 2} >}}{{< {Y\; 1}},{{Y\; 2} >}}},$

where X1 represents the first feature vector, X2 represents the secondfeature vector, Y1 represents the first confidence vector, Y2 representsthe second confidence vector, < > represents calculating an innerproduct, and * represents multiplying by bit.

Optionally, the above formula may also be expressed as

${D = \frac{K\;{1 \cdot K}\; 2}{Y\;{1 \cdot Y}\; 2}},$where

K1, K2, Y1, Y2 are vectors in the same dimension, K1·K2 represents theinner product of K1 and K2 (i.e., dot product), Y1·Y2 represents theinner product of Y1 and Y2. And the elements of K1 and K2 satisfy: K1_(i)=(X1 _(i)−X2 _(i))×Y1 _(i), K2 _(i)=(X1 _(i)−X2 _(i))×Y2 _(i).Herein, X1 _(i), X2 _(i), Y1 _(i), Y2 _(i), K1 _(i), K2 _(i) representthe i-th element of vectors X1, X2, Y1, Y2, K1, K2.

The calculating sub-module 3210 may be specifically configured tocalculate the similarity using the following formula:

${S = \frac{1}{1 + e^{{A \times D} + B}}},$where S represents the similarity, D represents the distance, and A andB are preset parameters.

Exemplarily, the determining sub-module 3220 may be specificallyconfigured to determine that the first face and the second face belongto the same person if the similarity is greater than or equal to asimilarity threshold; determine that the first face and the second facedo not belong to the same person if the similarity is less than thesimilarity threshold.

Exemplarily, the obtaining module 310 may be specifically configured toinput the first facial image into a trained neural network to obtain thefirst feature vector and the first confidence vector; input the secondfacial image to the trained neural network to obtain the second featurevector and the second confidence vector.

Exemplarily, a training module may be further comprised to obtain atrained neural network by means of training according to a face sampledata set.

The apparatus 30 shown in FIG. 3 can implement the facial recognitionmethod shown in FIG. 2, in order to avoid repetition, no more detailsare repeated herein.

FIG. 4 shows a schematic diagram of a non-transitory recording mediumaccording to an embodiment of the present disclosure. As shown in FIG.4, the non-transitory recording medium 400 according to an embodiment ofthe present disclosure stores a computer program 401, steps of the facerecognition method illustrated in the above are carried out when thecomputer program 401 is executed by a computer.

In addition, an embodiment of the present disclosure further providesanother facial recognition system, comprising a memory, a processor, anda computer program stored in the memory and running on the processor,wherein steps of the facial recognition method according to FIG. 2 arecarried out when the processor implements the computer program.

In addition, an embodiment of the present disclosure further provides anelectronic device, the electronic device may comprise the apparatus 30as shown in FIG. 3. The facial recognition method shown in FIG. 2 may beachieved by the electronic device.

The embodiments of the present disclosure provide a method, apparatusand facial recognition system, and a non-transitory recording medium,credibility of respective elements in the corresponding feature vectorcan be represented by the confidence vector, and further, similaritybetween two faces can be jointly calculated based on the feature vectorand the confidence vector, which can avoid the feature vectorunavailability situation caused by face occlusion, and the similarityobtained by this method is independent of the occlusion state, therebyensuring the accuracy of facial recognition.

Although exemplary embodiments of the present disclosure have beendescribed with reference to the drawings, it should be understood that,these exemplary embodiments are merely illustrative, not intended tolimit the scope of the present disclosure thereto. A person of ordinaryskill in the art may make various changes and modifications, thereto,without departing from the scope and spirit of the present disclosure.All of these changes and modifications are intended to be included inthe scope of the present disclosure as required based on the claimsattached thereto.

A person of ordinary skill in the art may be aware that, units andalgorithm steps described as examples in combination with theembodiments disclosed in this specification may be implemented byelectronic hardware or a combination of computer software and electronichardware. Whether the functions are performed by hardware or softwaredepends on particular applications and design constraint conditions ofthe technical solutions. A person skilled in the art may use differentmethods to implement the described functions for each particularapplication, but it should not be considered that the implementationgoes beyond the scope of the present disclosure.

In the several embodiments provided in the present disclosure, it shouldbe understood that the disclosed system, apparatus, and method may beimplemented in other manners. For example, the described apparatusembodiment is merely exemplary. For example, the unit division is merelylogical function division and may be other division in actualimplementation. For example, a plurality of units or components may becombined or integrated into another apparatus, or some features may beignored or not performed.

The description provided here has illustrated a lot of specific details.However, it should be understood that, the embodiments of the presentdisclosure can be practiced without these specific details. In someembodiments, the well-known methods, structures and techniques are notillustrated in detail, so that the description will not be obscure to beunderstood.

Similarly, it should be understood that, in order to simplify thepresent disclosure and help to understand one or more of various aspectsof the present disclosure, the various features of the presentdisclosure, in the aforesaid description of illustrative embodiments ofthe present disclosure, are sometimes grouped into a single embodiment,drawing, or description thereof. However, the disclosed method shouldnot be explained as reflecting the following intention: i.e. theinvention sought for protection claims more features than the featuresclearly defined in any claim. To put more precisely, as is reflected inthe following claims, the inventive point contains less features thanall the features of a single embodiment disclosed hereinbefore.Therefore, the claims complying with a specific embodiment areexplicitly incorporated into the specific embodiment, wherein everyclaim itself acts as an individual embodiment of the present disclosure.

A person skilled in the art can understand that, except that at leastsome of these features and/or process or units are exclusive to eachother, any combinations can be adopted to combine all the featuresdisclosed by the description (including the attached claims, abstractand drawings) and any method or all process of the device or unitdisclosed as such. Unless there is explicit statement, every featuredisclosed by the present description (including the attached claims,abstract and drawings) can be replaced by substitute feature providingthe same, equivalent or similar purpose.

In addition, a person skilled in the art can understand that, althoughsome embodiments described here comprise some features instead of otherfeatures included in other embodiments, the combination of features ofdifferent embodiments are deemed as falling into the scope of thepresent disclosure and forming different embodiments. For example, inthe claims, any one of the embodiments sought for protection can be usedin various combination modes.

The various components embodiments of the present disclosure can berealized by hardware, or realized by software modules running on one ormore processors, or realized by combination thereof. A person skilled inthe art should understand that, microprocessor or digital signalprocessor (DSP) can be used for realizing some or all functions of someor all components of the devices for presenting relevant information ofaccessed website according to the embodiments in the present disclosurein practice. The present disclosure can also realize one part of or alldevices or programs (for example, computer programs and computer programproducts) used for carrying out the method described here. Such programsfor realizing the present disclosure can be stored in computer-readablemedium, or can possess one or more forms of signal. Such signals can bedownloaded from the Internet website or be provided at signal carriers,or be provided in any other forms.

It should be noticed that, the forgoing embodiments are intended toillustrate the present disclosure and are not for limiting the presentdisclosure, and a person skilled in the art can design substituteembodiments without departing from the scope of the appended claims. Inthe claims, any reference marks between brackets should not be construedas limit for the claims. The word “comprise” does not exclude elementsor steps that are not listed in the claims. The word “a” or “one” beforethe elements does not exclude the existence of a plurality of suchelements. The present disclosure can be realized by means of hardwarecomprising several different elements and by means of properlyprogrammed computer. In the unit claims listing several devices, severalof the devices can be embodied by a same hardware item. The use of words“first”, “second” and “third” does not mean any sequence. These wordscan be explained as name.

The above is only the specific implementations of the present disclosureor the description of the specific embodiments, and the scope of thepresent disclosure is not limited thereto, and all changes orsubstitutions that can be easily conceived of by a person skilled in theart should be included within the technical scope of the presentdisclosure. The scope of the present disclosure should be determined bythe scope of the claims.

What is claimed is:
 1. A facial recognition method, the methodcomprising: obtaining a first feature vector of a first face in a firstfacial image and a first confidence vector having the same dimension asthe first feature vector, wherein elements in the first confidencevector are used to indicate credibility of features represented by thecorresponding elements in the first feature vector; obtaining a secondfeature vector of a second face in a second facial image and a secondconfidence vector having the same dimension as the second featurevector, wherein elements in the second confidence vector are used toindicate credibility of features represented by the correspondingelements in the second feature vector; and determining, according to thefirst feature vector, the first confidence vector, the second featurevector and the second confidence vector, whether the first face and thesecond face belong to the same person, wherein determining, according tothe first feature vector, the first confidence vector, the secondfeature vector and the second confidence vector, whether the first faceand the second face belong to the same person comprises: calculating adegree of coincidence between the first confidence vector and the secondconfidence vector; and if the degree of coincidence is less than apreset threshold, determining that it is impossible to determine whetherthe first face and the second face belong to the same person; if thedegree of coincidence is greater than or equal to the preset threshold,calculating a similarity between the first face and the second faceaccording to the first confidence vector, the first feature vector, thesecond confidence vector and the second feature vector, and determiningwhether the first face and the second face belong to the same personaccording to the similarity.
 2. The method according to claim 1, whereincalculating a degree of coincidence between the first confidence vectorand the second confidence vector comprises: obtaining the degree ofcoincidence by calculating an inner product of the first confidencevector and the second confidence vector.
 3. The method according toclaim 1, wherein calculating a similarity between the first face and thesecond face according to the first confidence vector, the first featurevector, the second confidence vector and the second feature vectorcomprises: calculating a distance between the first face and the secondface according to the first confidence vector, the first feature vector,the second confidence vector and the second feature vector; andcalculating a similarity between the first face and the second faceaccording to the distance.
 4. The method according to claim 3, whereinthe distance is calculated using the following formula:${D = \frac{{< {\left( {{X\; 1} - {X\; 2}} \right)*Y\; 1}},{{\left( {{X\; 1} - {X\; 2}} \right)*Y\; 2} >}}{{< {Y\; 1}},{{Y\; 2} >}}},$where X1 represents the first feature vector, X2 represents the secondfeature vector, Y1 represents the first confidence vector, Y2 representsthe second confidence vector, < > represents calculating an innerproduct, and * represents multiplying by bit.
 5. The method according toclaim 3, wherein the similarity is calculated using the followingformula: ${S = \frac{1}{1 + e^{{A \times D} + B}}},$ where S representsthe similarity, D represents the distance, and A and B are presetparameters.
 6. The method according to claim 1, wherein obtaining afirst feature vector of a first face in a first facial image and a firstconfidence vector having the same dimension as the first feature vectorcomprises: inputting the first facial image into a trained neuralnetwork to obtain the first feature vector and the first confidencevector; and wherein obtaining a second feature vector of a second facein a second facial image and a second confidence vector having the samedimension as the second feature vector comprises: inputting the secondfacial image to the trained neural network to obtain the second featurevector and the second confidence vector.
 7. A facial recognition system,comprising a memory, a processor, and a computer program stored in thememory and running on the processor, wherein steps of a facialrecognition method are implemented when the computer program is executedby the processor, the method comprising: obtaining a first featurevector of a first face in a first facial image and a first confidencevector having the same dimension as the first feature vector, whereinelements in the first confidence vector are used to indicate credibilityof features represented by the corresponding elements in the firstfeature vector; obtaining a second feature vector of a second face in asecond facial image and a second confidence vector having the samedimension as the second feature vector, wherein elements in the secondconfidence vector are used to indicate credibility of featuresrepresented by the corresponding elements in the second feature vector;and determining, according to the first feature vector, the firstconfidence vector, the second feature vector and the second confidencevector, whether the first face and the second face belong to the sameperson, wherein determining, according to the first feature vector, thefirst confidence vector, the second feature vector and the secondconfidence vector, whether the first face and the second face belong tothe same person comprises: calculating a degree of coincidence betweenthe first confidence vector and the second confidence vector; and if thedegree of coincidence is less than a preset threshold, determining thatit is impossible to determine whether the first face and the second facebelong to the same person; if the degree of coincidence is greater thanor equal to the preset threshold, calculating a similarity between thefirst face and the second face according to the first confidence vector,the first feature vector, the second confidence vector and the secondfeature vector, and determining whether the first face and the secondface belong to the same person according to the similarity.
 8. Thesystem according to claim 7, wherein calculating a degree of coincidencebetween the first confidence vector and the second confidence vectorcomprises: obtaining the degree of coincidence by calculating an innerproduct of the first confidence vector and the second confidence vector.9. The system according to claim 7, wherein calculating a similaritybetween the first face and the second face according to the firstconfidence vector, the first feature vector, the second confidencevector and the second feature vector comprises: calculating a distancebetween the first face and the second face according to the firstconfidence vector, the first feature vector, the second confidencevector and the second feature vector; and calculating a similaritybetween the first face and the second face according to the distance.10. The system according to claim 9, wherein the distance is calculatedusing the following formula:${D = \frac{{< {\left( {{X\; 1} - {X\; 2}} \right)*Y\; 1}},{{\left( {{X\; 1} - {X\; 2}} \right)*Y\; 2} >}}{{< {Y\; 1}},{{Y\; 2} >}}},$where X1 represents the first feature vector, X2 represents the secondfeature vector, Y1 represents the first confidence vector, Y2 representsthe second confidence vector, < > represents calculating an innerproduct, and * represents multiplying by bit.
 11. The system accordingto claim 9, wherein the similarity is calculated using the followingformula: ${S = \frac{1}{1 + e^{{A \times D} + B}}},$ where S representsthe similarity, D represents the distance, and A and B are presetparameters.
 12. The system according to claim 7, wherein obtaining afirst feature vector of a first face in a first facial image and a firstconfidence vector having the same dimension as the first feature vectorcomprises: inputting the first facial image into a trained neuralnetwork to obtain the first feature vector and the first confidencevector; and obtaining a second feature vector of a second face in asecond facial image and a second confidence vector having the samedimension as the second feature vector comprises: inputting the secondfacial image to the trained neural network to obtain the second featurevector and the second confidence vector.
 13. A non-transitory recordingmedium on which a computer program is stored, wherein steps of a facialrecognition method are implemented when the computer program is executedby a processor, the method comprising: obtaining a first feature vectorof a first face in a first facial image and a first confidence vectorhaving the same dimension as the first feature vector, wherein elementsin the first confidence vector are used to indicate credibility offeatures represented by the corresponding elements in the first featurevector; obtaining a second feature vector of a second face in a secondfacial image and a second confidence vector having the same dimension asthe second feature vector, wherein elements in the second confidencevector are used to indicate credibility of features represented by thecorresponding elements in the second feature vector; and determining,according to the first feature vector, the first confidence vector, thesecond feature vector and the second confidence vector, whether thefirst face and the second face belong to the same person, whereindetermining, according to the first feature vector, the first confidencevector, the second feature vector and the second confidence vector,whether the first face and the second face belong to the same personcomprises: calculating a degree of coincidence between the firstconfidence vector and the second confidence vector; and if the degree ofcoincidence is less than a preset threshold, determining that it isimpossible to determine whether the first face and the second facebelong to the same person; if the degree of coincidence is greater thanor equal to the preset threshold, calculating a similarity between thefirst face and the second face according to the first confidence vector,the first feature vector, the second confidence vector and the secondfeature vector, and determining whether the first face and the secondface belong to the same person according to the similarity.
 14. Thenon-transitory recording medium according to claim 13, whereincalculating a degree of coincidence between the first confidence vectorand the second confidence vector comprises: obtaining the degree ofcoincidence by calculating an inner product of the first confidencevector and the second confidence vector.
 15. The non-transitoryrecording medium according to claim 13, wherein calculating a similaritybetween the first face and the second face according to the firstconfidence vector, the first feature vector, the second confidencevector and the second feature vector comprises: calculating a distancebetween the first face and the second face according to the firstconfidence vector, the first feature vector, the second confidencevector and the second feature vector; and calculating a similaritybetween the first face and the second face according to the distance.16. The non-transitory recording medium according to claim 15, whereinthe distance is calculated using the following formula:${D = \frac{{< {\left( {{X\; 1} - {X\; 2}} \right)*Y\; 1}},{{\left( {{X\; 1} - {X\; 2}} \right)*Y\; 2} >}}{{< {Y\; 1}},{{Y\; 2} >}}},$where X1 represents the first feature vector, X2 represents the secondfeature vector, Y1 represents the first confidence vector, Y2 representsthe second confidence vector, < > represents calculating an innerproduct, and * represents multiplying by bit.
 17. The non-transitoryrecording medium according to claim 15, wherein the similarity iscalculated using the following formula:${S = \frac{1}{1 + e^{{A \times D} + B}}},$ where S represents thesimilarity, D represents the distance, and A and B are presetparameters.